package com.njtoyo.taxi.admin.rest.presenter.business;

import com.alibaba.fastjson.JSON;
import com.njtoyo.taxi.admin.mapper.master.entity.Account;
import com.njtoyo.taxi.admin.mapper.master.entity.User;
import com.njtoyo.taxi.admin.mapper.master.enums.CustomerLogoutLogState;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel("乘客注销列表实体")
public class CustomerLogoutListPresenter {

    @ApiModelProperty("申请ID")
    private Long id;

    @ApiModelProperty("乘客信息")
    private User customer;

    @ApiModelProperty("账户信息")
    private Account account;

    @ApiModelProperty("注销原因")
    private Object logoutReason;

    @ApiModelProperty(value = "状态")
    private CustomerLogoutLogState logoutState;

    @ApiModelProperty(value = "申请注销的时间")
    private Long applyTimestamp;

    @ApiModelProperty(value = "注销通过的时间")
    private Long adoptTimestamp;

    @ApiModelProperty(value = "创建时间")
    private Date createdAt;

    @ApiModelProperty(value = "修改时间")
    private Date updatedAt;

    public void setLogoutReason(String logoutReason) {
        this.logoutReason = JSON.parse(logoutReason);
    }
}
